---
layout: m1x_soap
title: Catalog Product Attribute
---

<h2><a name="MAPI-ProductAttributes-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>

<p>The Mage_Catalog module allows you to manage categories and products.</p>

<h4><a name="MAPI-ProductAttributes-ProductAttributes"></a>Product Attributes</h4>

<p>Allows you to retrieve product attributes and options.</p>

<p><b>Resource Name</b>: catalog_product_attribute</p>

<p><b>Aliases</b>:</p>
<ul>
	<li>product_attribute</li>
</ul>


<p><b>Methods</b>:</p>
<ul>
	<li><a href="product_attribute.currentStore.html" title="product_attribute.currentStore">product_attribute.currentStore</a><font color="#000000">&nbsp;&#45; Set/Get the current store view</font></li>
	<li><a href="product_attribute.list.html" title="product_attribute.list">product_attribute.list</a><font color="#000000">&nbsp;&#45; Retrieve the attribute list</font></li>
	<li><a href="product_attribute.options.html" title="product_attribute.options">product_attribute.options</a><font color="#000000">&nbsp;&#45; Retrieve the attribute options</font></li>
	<li><a href="product_attribute.addOption.html" title="product_attribute.addOption">product_attribute.addOption</a><font color="#000000">&nbsp;&#45; Add a new option for attributes with selectable fields</font></li>
	<li><a href="product_attribute.create.html" title="product_attribute.create">product_attribute.create</a><font color="#000000">&nbsp;&#45; Create a new attribute</font></li>
	<li><a href="product_attribute.info.html" title="product_attribute.info">product_attribute.info</a><font color="#000000">&nbsp;&#45; Get full information about an attribute with the list of options</font></li>
	<li><a href="product_attribute.remove.html" title="product_attribute.remove">product_attribute.remove</a><font color="#000000">&nbsp;&#45; Remove the required attribute</font></li>
	<li><a href="product_attribute.removeOption.html" title="product_attribute.removeOption">product_attribute.removeOption</a><font color="#000000">&nbsp;&#45; Remove an option for attributes with selectable fields</font></li>
	<li><a href="product_attribute.types.html" title="product_attribute.types">product_attribute.types</a><font color="#000000">&nbsp;&#45; Get the list of possible attribute types</font></li>
	<li><a href="product_attribute.update.html" title="product_attribute.update">product_attribute.update</a><font color="#000000">&nbsp;&#45; Update the required attribute</font></li>
</ul>



<h5><a name="MAPI-ProductAttributes-Faults%3A"></a>Faults:</h5>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Requested store view not found. </td>
</tr>
<tr>
<td> 101 </td>
<td> Requested attribute not found. </td>
</tr>
<tr>
<td> 102 </td>
<td> Invalid request parameters. </td>
</tr>
<tr>
<td> 103 </td>
<td> Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore (_) in this field, first character should be a letter. </td>
</tr>
<tr>
<td> 104 </td>
<td> Incorrect attribute type. </td>
</tr>
<tr>
<td> 105 </td>
<td> Unable to save attribute. </td>
</tr>
<tr>
<td> 106 </td>
<td> This attribute cannot be deleted. </td>
</tr>
<tr>
<td> 107 </td>
<td> This attribute cannot be edited. </td>
</tr>
<tr>
<td> 108 </td>
<td> Unable to add option. </td>
</tr>
<tr>
<td> 109 </td>
<td> Unable to remove option. </td>
</tr>
</tbody></table>


<h5><a name="MAPI-ProductAttributes-Example%3A"></a>Example:</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">&lt;pre&gt;
&lt;?php
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

echo "&lt;pre&gt;";
// Create new attribute
$attributeToCreate = array(
    "attribute_code" =&gt; "new_attribute",
    "scope" =&gt; "store",
    "frontend_input" =&gt; "select",
    "is_unique" =&gt; 0,
    "is_required" =&gt; 0,
    "is_configurable" =&gt; 0,
    "is_searchable" =&gt; 0,
    "is_visible_in_advanced_search" =&gt; 0,
    "used_in_product_listing" =&gt; 0,
    "additional_fields" =&gt; array(
        "is_filterable" =&gt; 1,
        "is_filterable_in_search" =&gt; 1,
        "position" =&gt; 1,
        "used_for_sort_by" =&gt; 1
    ),
    "frontend_label" =&gt; array(
        array(
            "store_id" =&gt; 0,
            "label" =&gt; "A new attribute"
        )
    )
);

$attributeId = $proxy-&gt;call(
    $sessionId,
    "product_attribute.create",
    array(
        $attributeToCreate
    )
);

// Update attribute
$attributeToUpdate = array(
    "scope" =&gt; "global",
    "is_unique" =&gt; 1,
    "is_required" =&gt; 1,
    "is_configurable" =&gt; 1,
    "is_searchable" =&gt; 1,
    "is_visible_in_advanced_search" =&gt; 0,
    "used_in_product_listing" =&gt; 0,
    "additional_fields" =&gt; array(
        "is_filterable" =&gt; 01,
        "is_filterable_in_search" =&gt; 0,
        "position" =&gt; 2,
        "used_for_sort_by" =&gt; 0
    ),
    "frontend_label" =&gt; array(
        array(
            "store_id" =&gt; 0,
            "label" =&gt; "A Test Attribute"
        )
    )
);
$proxy-&gt;call(
    $sessionId,
    "product_attribute.update",
    array(
         "new_attribute",
         $attributeToUpdate
    )
);

// Add option
$optionToAdd = array(
    "label" =&gt; array(
        array(
            "store_id" =&gt; 0,
            "value" =&gt; "New Option"
        )
    ),
    "order" =&gt; 0,
    "is_default" =&gt; 0
);

$proxy-&gt;call(
    $sessionId,
    "product_attribute.addOption",
    array(
         $attributeId,
         $optionToAdd
    )
);

// Get info
$resultInfo = $proxy-&gt;call(
    $sessionId,
    "product_attribute.info",
    array(
         $attributeId
    )
);
echo "info result:\n";
print_r($resultInfo);

// List options
$resultListOptions = $proxy-&gt;call(
    $sessionId,
    "product_attribute.options",
    array(
         $attributeId
    )
);
echo "\n options result:\n";
print_r($resultListOptions);

// Remove option
$result = $proxy-&gt;call(
    $sessionId,
    "product_attribute.removeOption",
    array(
         $attributeId,
         $resultInfo['options'][0]['value']
    )
);

// remove attribute
$result = $proxy-&gt;call(
    $sessionId,
    "product_attribute.remove",
    array(
         $attributeId
    )
);</pre>
		</div>
</div></div>

				    
Create the Magento file system owner                   			    
